#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <string>
using namespace std;



class Gloves {
public:
    int findMinimum(int n, vector<int> left, vector<int> right) {
        // write code here
        vector<int> pleft;
        vector<int> pright;
        int min1 = 0;
        for (int i = 0; i < n; i++)
        {
            if (left[i] == 0 | right[i] == 0)
            {
                min1 += (left[i] + right[i]);
            }
            else
            {
                pleft.push_back(left[i]);
                pright.push_back(right[i]);
            }
        }
        sort(pleft.begin(), pleft.end());
        sort(pright.begin(), pright.end());
        int sum1 = 0;
        int sum2 = 0;
        int p = pleft.size();
        for (int i = 1; i < p; i++)
        {
            sum1 += pleft[i];
            sum2 += pright[i];
        }
        min1 += min(sum1, sum2) + 2;
        return min1;
    }
};

int main()
{
    vector<int> left = { 0,7,1,6 };
    vector<int> right = { 1,5,0,6 };
    Gloves g;
    g.findMinimum(4, left, right);
    return 0;
}

int main() {
    int n;
    while (cin >> n)
    {
        int i = 0;
        int ret = 0;
        while (i < 32)
        {
            if ((n >> i) & 1)
            {
                ret++;
            }
            i++;
        }
        cout << ret << endl;
    }
}


int main() {
    int n;
    cin >> n;
    int m = n * 2 - 1;
    int ret = -1;
    vector<vector<int>> v1(n, vector<int>(m + 2));
    v1[0][m / 2 + 1] = 1;
    for (int i = 1; i < n; i++)
    {
        for (int k = 1; k < m + 1; k++)
        {
            v1[i][k] = v1[i - 1][k - 1] + v1[i - 1][k] + v1[i - 1][k + 1];
        }
    }
    for (int i = 1; i < m + 1; i++)
    {
        if (v1[n - 1][i] % 2 == 0)
        {
            ret = i;
            break;
        }
    }
    cout << ret << endl;
    return 0;
}

int main() {
    int n;
    cin >> n;
    int ret = -1;
    if (n <= 2)
    {
        cout << "-1" << endl;
    }
    else
    {
        if (n % 2 == 0)
        {
            cout << "3" << endl;
        }
        else
        {
            cout << "2" << endl;
        }
    }
    return 0;
}

int main() {
    string str;
    getline(cin, str);
    transform(str.begin(), str.end(), str.begin(), ::tolower);
    char str2;
    cin >> str2;
    str2 = tolower(str2);
    unordered_map<char, int> hash;
    for (auto s : str)
    {
        hash[s]++;
    }
    cout << hash[str2] << endl;
    return 0;
}

int main() {
    int n;
    cin >> n;
    long long sum = 0;
    vector<long long> v(3);
    v[0] = 1;
    for (int i = 1; i < n; i++)
    {
        v[2] = v[1] + v[2];
        v[1] = v[0];
        v[0] = v[2];
    }
    cout << v[2] + v[1] + v[0] << endl;
    return 0;
}

#include <algorithm>
#include <iostream>
using namespace std;

int main() {
    string str1;
    string str2;
    cin >> str1 >> str2;
    transform(str1.begin(), str1.end(), str1.begin(), ::tolower);
    transform(str2.begin(), str2.end(), str2.begin(), ::tolower);
    for (auto s : str2)
    {
        if ((s < '0' && s>'9') && (s < 'a' && s>'z'))
        {
            cout << "false" << endl;
            return 0;
        }
    }
    int start1 = 0;
    int start2 = 0;
    int n1 = str1.size();
    int n2 = str2.size();
    while (start1 < n1 && start2 < n2)
    {
        if (str1[start1] != str2[start2] && str1[start1] == '?')
        {
            start1++;
            start2++;
        }
        else if (str1[start1] != str2[start2] && str1[start1] == '*')
        {
            if (start2 + 1 <= n2 && str1[start1] == str2[start2 + 1])
            {
                start1++;
                start2 += 2;
            }
            else if (start2 + 2 <= n2 && str1[start1] == str2[start2 + 2])
            {
                start1++;
                start2 += 3;
            }
            else if (start2 + 2 <= n2 && start1 + 1 <= n1 && str1[start1 + 1] == str2[start2 + 2])
            {
                start1 += 2;
                start2 += 3;
            }
            else
            {
                cout << "false" << endl;
                return 0;
            }
        }
        else
        {
            cout << "false" << endl;
            return 0;
        }
    }
    if (start2 >= n2 && start1 >= n1)
    {
        cout << "true" << endl;
        return 0;
    }
    cout << "false" << endl;
    return 0;
}